package org.gitos.cloud.util;

/**
 * Created by shizhengchu on 16/1/18.
 */
public class CmdUtil {
    /**
     * comet->device 下发
     * device->comet上报
     * 0000 0000 0000 0000表示下发
     * 0000 0001 0000 0000表示上报
     * unsigned short cmd = 0;
     * (cmd & 0x0100) == 0 ? 下发 : 上报
     *
     * @param cmd
     * @return
     */
    public static boolean isUp(short cmd) {
        return (cmd & 0x0100) == 0 ? false : true;
    }

    public static boolean isDown(short cmd) {
        return (cmd & 0x0100) == 0 ? true : false;
    }

}
